package com.hfzy.ihk.web.callhistoryold.enumType;

import java.util.HashMap;
import java.util.Map;

//Call客时的界面
public enum CallFromType {

    LinkageCallPhone("LC", "联动Call客"), //--->pageFrom:3
    ContinueFollow("CF", "联动Call客继续跟进"),//--->pageFrom:10
    CustomerEbook("CE", "电子客簿"),//--->pageFrom:4
    TestCall("TC", "测试电话"),
    PropertyCallPhone("PC","盘源详细页"),//--->pageFrom:2
    APPCallRecordPhone("APPR","房专家通话记录"),//6
    APPCallRecordPhoneForPC("APPPC","房专家楼盘业主通话记录"),//--->pageFrom:9
    APPCallRecordPhoneForLC("APPLC","房专家联动call客通话记录"),//8
    CALLIN("IC","呼入记录"),
    CROSSESTATEAPPLY("CEA","申请跨区登记通话记录"),//--->pageFrom:22
    ADDESTATEPATH("AEP","新增路径通话记录"),//--->pageFrom:33
    APPLYREPUTPROPERTY("ARP","重新放盘通话记录"),//--->pageFrom:44
    TAOCUSTOMER("TAOC","淘客"),//--->pageFrom:55
    CALLHISTORY("CH","云呼管理记录");


    /*APP_ESTAE("盘源", 0),
    APP_LINK_CALL("联动CALL",1),
    APP_CUSTOMER("电子客簿", 7),
    APP_CALL_HISTORY("APP呼叫历史",6),

    PC_ESTATE("盘源", 2),
    PC_LINK_CALL("联动CALL客", 3),
    PC_CUSTOMER("电子客簿", 4),

    PC_KQ("申请跨区登记", 22),
    PC_XZ("新增路径", 33),
    PC_CF("重新放盘", 44),
    PC_TAOCUSTOMER("淘客",55),
    PC_CALLHISTORY("云呼管理报表",66),

    PC_TEST("置业测试座机", 5);*/

    private String value;
    private String desc;

    CallFromType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String toStr() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    static Map<String, CallFromType> valueMap = new HashMap<String, CallFromType>();
    static Map<String, CallFromType> descMap = new HashMap<String, CallFromType>();

    static {
        for(CallFromType value : CallFromType.values()) {
            valueMap.put(value.toStr(), value);
            valueMap.put(value.getDesc(), value);
        }
    }

    static CallFromType fromStr(String value) {
        CallFromType ret = valueMap.get(value);
        if(ret != null) {
            return ret;
        }else {
            throw new IllegalArgumentException("No enum const " + CallFromType.class + "." + value);
        }
    }

    static CallFromType fromDesc(String desc) {
        CallFromType ret = descMap.get(desc);
        if(ret != null) {
            return ret;
        }else {
            throw new IllegalArgumentException("No enum const " + CallFromType.class + "." + desc);
        }
    }

}